<?php
	/*获取类别下拉列表*/
	require "../autoload.php";
	$mp = new MyPdo();
	$sql = "select * from translate_type order by id";
	$arr = array();
	$res = $mp->dql($sql,$arr);
	if(!$res){
		exit('[]');
	}
	$sql2 = "select tid from translate_not_join";
	$res2 = $mp->dql($sql2,array());
	$tids = array();
	if($res2){
		foreach($res2 as $v){
			$tid = $v['tid'];
			if($res){
				foreach($res as $yk=>$yv){
					if($tid == $yv['id']){
						$res[$yk]['name'] = '^'.$yv['name'];
					}
				}
			}
		}
	}
	$tmp_arr = Array();
	foreach($res as $v){
		array_push($tmp_arr,$v);
	}
	ob_start();
	echo json_encode($tmp_arr);
	$res = ob_get_contents();
	$dir = '../Runtime/Cache_long';
	$file = $dir.'/indexButtonGroup_tabType';
	if(!is_dir($dir)){
		mkdir($dir,0777,true);
	}
	if(!file_exists($file)){
		file_put_contents($file, $res);
	}
	exit;
